package com.ithema.method1;

import java.util.Random;

public class Test {
    public static void main(String[] args) {
        Random rand=new Random();
        int sum=0;
        int arr[]=new int[6];
        for (int i = 0; i < arr.length; i++) {
            arr[i]= rand.nextInt(100);
        }
        for (int i = 0; i < arr.length; i++) {
            sum+=arr[i];
        }
        System.out.println("数组中所有元素之和为："+sum);
    }
}
